package com.forg.mvc.core;

public class RequestContext {
    
    private static ThreadLocal<RequestWraper> request = new ThreadLocal<>();
    
    private static ThreadLocal<ResponseWraper> response = new ThreadLocal<>();
    
    public static RequestWraper getRequest(){
        return request.get();
    }
    
    public static void setRequest(RequestWraper r){
        request.set(r);
    }
    
    public static void removeRequest(){
        request.remove();
    }
    
    public static ResponseWraper getResponse(){
        return response.get();
    }
    
    public static void setResponse(ResponseWraper r){
        response.set(r);
    }
    
    public static void removeResponse(){
        response.remove();
    }
    
    public static void clear(){
        removeRequest();
        removeResponse();
    }

}
